﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media.Imaging;
using System.Windows.Media;
using System.Windows;
using System.Globalization;
using MOJsdk;

namespace MojBlack
{
    public class MyStyle : IStyle
    {
        public string StyleName { get { return "MoJBlack"; } }
        public string StyleDeveloper { get { return "Davidblkx"; } }
        public double StyleVersion { get { return 0.1; } }

        public Style LoadStyle(ElementInfo Info)
        {
            Style _style = null;

            if (Info.ElementType == typeof(MojToolButton))
                return GetMojToolButtonStyle(Info);

            _style = LoadStyleByKeyValue(Info.ElementID);
            if (_style == null)
                _style = LoadStyleByKeyValue("Default" + Info.ElementType.Name);

            return _style;
        }
        public Style LoadStyleByKeyValue(string KeyValue)
        {
            return new Settings().Resources[KeyValue] as Style;
        }

        public UserControl StyleSettings { get { return null; } }
        public Style GetMojToolButtonStyle(ElementInfo Info)
        {
            MojToolButton btn = (MojToolButton)Info.Element;

            if (btn.Image != null)
            {
                btn.Content = new Image { Source = new BitmapImage(new Uri(btn.Image)), };
                return LoadStyleByKeyValue("ImageMojToolButton");
            }

            Style _style = null;

            _style = LoadStyleByKeyValue(Info.ElementID);
            if (_style == null)
                _style = LoadStyleByKeyValue("Default" + Info.ElementType.Name);

            return _style;
        }
    }
}

namespace Converters
{

}
